package com.luomu.base.api.service;

import com.luomu.base.api.bo.ChatSendReqBO;
import com.luomu.base.api.bo.Message;
import com.luomu.base.api.enmus.MessageType;
import com.luomu.base.api.service.CompletedCallBackService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Flux;

import java.util.List;

/**
 * @author niuxiangqian
 * @version 1.0
 * @date 2023/3/23 14:47
 **/
public interface UserChatService extends CompletedCallBackService {
    /**
     * 发送消息
     *
     * @param chatSendReqBO
     */
    @PostMapping(value = "/send", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    Flux<String> sendText(@RequestBody ChatSendReqBO chatSendReqBO);

    /**
     * 消息历史
     *
     * @param chatSendReqBO
     * @return
     */
    @PostMapping("/getHistory")
    List<Message> getHistory(@RequestBody ChatSendReqBO chatSendReqBO);


}
